<?php

declare(strict_types=1);

namespace App\Command;

use Hyperf\Command\Command as HyperfCommand;
use Hyperf\Command\Annotation\Command;
use Psr\Container\ContainerInterface;

/**
 * @Command
 */
class FooCommand extends HyperfCommand
{


    /**
     * @var ContainerInterface
     */
    protected $container;

    public function __construct(ContainerInterface $container)
    {
        $this->container = $container;

        parent::__construct('foo:hello');
    }

    public function configure()
    {
        parent::configure();
        $this->setHelp('Hyperf 自定义命令演示');
        $this->setDescription('Hyperf Demo Command');
        $this->addUsage('--name 演示代码');
    }

    public function handle()
    {
        // 从 $input 获取 name 参数
        $argument = 'World';
        $this->line('Hello ' . $argument, 'info');
    }


}
